<template>
  <div class="siblingB">
    B组件
    <button @click="clickSend">发布通知</button>
  </div>
</template>

<script>
import Bus from '../EventBus.js'
export default {
    methods: {
      clickSend () {
        Bus.$emit('sendMsg', '收到来自B的消息')
      }
    }
}
</script>

<style>
 .siblingB {
    width: 200px;
    height: 200px;
    border: 3px solid;
 }
</style>